package com.jplus.utils;

import java.security.MessageDigest;
import sun.misc.BASE64Encoder;

public class MD5Util {
	public static String encode(String message) {
		try {
			MessageDigest mDigest = MessageDigest.getInstance("md5");
			byte b[] = mDigest.digest(message.getBytes());
			return new BASE64Encoder().encode(b);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public static void main(String[] args) {
		System.out.println(encode("12345"));
		;
	}
}
